package servlet;

import dao.BookDao;
import dao.IDAO;

import java.io.IOException;
import java.util.List;

public class SelectBookServlet extends javax.servlet.http.HttpServlet {
    protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html; charset=utf-8");

        IDAO dao=new BookDao();
        List list=dao.getAll();
        request.setAttribute("books",list);
        request.getRequestDispatcher("display.jsp").forward(request,response);
    }

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
        doPost(request,response);
    }
}
